package com.smart.campus.controller;

import com.smart.campus.dto.ShDepartment;
import com.smart.campus.interfaces.ShDepartmentServiceApi;
import com.smart.campus.pojo.PagedResponse;
import com.smart.campus.service.ShDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsProject: smart-campus
 * @BelongsPackage: com.smart.campus.controller
 * @Author: JinBao shan
 * @date 2024/9/19 17:03
 * @Description: TODO
 * @Version: 1.0
 */

@RestController
public class ShDepartmentController implements ShDepartmentServiceApi {
    @Autowired
    private ShDepartmentService departmentService;

    @Override
    public PagedResponse<ShDepartment> findShDepartmentsPagination(ShDepartment department, Integer pageNum, Integer pageSize) {
        return departmentService.findShDepartmentsPagination(department,pageNum,pageSize);
    }

    @Override
    public List<ShDepartment> getShDepartmentList() {
        return departmentService.getShDepartmentList();
    }

    @Override
    public void addShDepartment(ShDepartment department) {
        departmentService.addShDepartment(department);
    }

    @Override
    public ShDepartment getShDepartmentById(Integer id) {
        return departmentService.getShDepartmentById(id);
    }

    @Override
    public void updateShDepartmentById(ShDepartment department) {
        departmentService.updateShDepartmentById(department);
    }

    @Override
    public void updateShDepartmentStatusById(ShDepartment department) {
        departmentService.updateShDepartmentStatusById(department);
    }

    @Override
    public void deleteShDepartmentById(Integer id) {
        departmentService.deleteShDepartmentById(id);
    }
}
